package com.ruoyi.system.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DeptYueMapper;
import com.ruoyi.system.domain.DeptYue;
import com.ruoyi.system.service.IDeptYueService;
import com.ruoyi.common.core.text.Convert;

/**
 * 单位余额Service业务层处理
 * 
 * @author zxl
 * @date 2023-07-05
 */
@Service
public class DeptYueServiceImpl implements IDeptYueService 
{
    @Autowired
    private DeptYueMapper deptYueMapper;

    /**
     * 查询单位余额
     * 
     * @param id 单位余额主键
     * @return 单位余额
     */
    @Override
    public DeptYue selectDeptYueById(String id)
    {
        return deptYueMapper.selectDeptYueById(id);
    }

    /**
     * 查询单位余额列表
     * 
     * @param deptYue 单位余额
     * @return 单位余额
     */
    @Override
    public List<DeptYue> selectDeptYueList(DeptYue deptYue)
    {
        return deptYueMapper.selectDeptYueList(deptYue);
    }

    /**
     * 新增单位余额
     * 
     * @param deptYue 单位余额
     * @return 结果
     */
    @Override
    public int insertDeptYue(DeptYue deptYue)
    {
        return deptYueMapper.insertDeptYue(deptYue);
    }

    /**
     * 修改单位余额
     * 
     * @param deptYue 单位余额
     * @return 结果
     */
    @Override
    public int updateDeptYue(DeptYue deptYue)
    {
        return deptYueMapper.updateDeptYue(deptYue);
    }

    /**
     * 批量删除单位余额
     * 
     * @param ids 需要删除的单位余额主键
     * @return 结果
     */
    @Override
    public int deleteDeptYueByIds(String ids)
    {
        return deptYueMapper.deleteDeptYueByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除单位余额信息
     * 
     * @param id 单位余额主键
     * @return 结果
     */
    @Override
    public int deleteDeptYueById(String id)
    {
        return deptYueMapper.deleteDeptYueById(id);
    }

    /**
     * @param deptId
     * @param pageIndex
     * @param pageSize
     * @return
     */
    @Override
    public List<Map<String, Object>> selectTuiKuanList(String deptId,String jingfeipicimingcheng, int pageIndex, int pageSize) {
        int startIndex = (pageIndex - 1) * pageSize;
        return deptYueMapper.selectTuiKuanList(deptId,jingfeipicimingcheng, startIndex, pageSize);
    }

    /**
     * @param deptId
     * @return
     */
    @Override
    public int countTuiKuanList(String deptId,String jingfeipicimingcheng) {
        return deptYueMapper.countTuiKuanList(deptId,jingfeipicimingcheng);
    }
}
